<template>
    <el-select @change="onChange" v-model="env" style="width: 110px;padding-right: 10px">
        <el-option
                v-for="item in dictionary.env"
                :key="item.value"
                :label="item.label"
                :value="item.value"
        >
        </el-option>
    </el-select>
</template>
<script type="ts" setup>
import {DictionaryStore} from "@/stores/dictionary";
import {WorkspaceStore} from "@/stores/workspace";
import {onMounted, ref} from "vue";
import {storeToRefs} from "pinia";

const env = ref("dev");

const dictionaryStore = DictionaryStore();
const workspaceStore = WorkspaceStore();
const {dictionary} = storeToRefs(dictionaryStore);

const onChange = (e) => {
    workspaceStore.setEnv(e);
}

onMounted(() => {
    dictionaryStore.lodeEnv();
    workspaceStore.setEnv(env.value);
})
</script>

